import type { TaxRateConfig } from "../types";

// Tax rate configurations by country
export const TAX_RATE_CONFIGS: Record<string, TaxRateConfig> = {
  // Sweden
  SE: {
    countryCode: "SE",
    taxType: "vat",
    defaultRate: 25,
    categoryRates: {
      meals: 12,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Finland
  FI: {
    countryCode: "FI",
    taxType: "vat",
    defaultRate: 25.5,
    categoryRates: {
      meals: 14,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Norway
  NO: {
    countryCode: "NO",
    taxType: "vat",
    defaultRate: 25,
    categoryRates: {
      meals: 15,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Denmark
  DK: {
    countryCode: "DK",
    taxType: "vat",
    defaultRate: 25,
    categoryRates: {
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Germany
  DE: {
    countryCode: "DE",
    taxType: "vat",
    defaultRate: 19,
    categoryRates: {
      meals: 7,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // France
  FR: {
    countryCode: "FR",
    taxType: "vat",
    defaultRate: 20,
    categoryRates: {
      meals: 10,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Netherlands
  NL: {
    countryCode: "NL",
    taxType: "vat",
    defaultRate: 21,
    categoryRates: {
      meals: 9,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Belgium
  BE: {
    countryCode: "BE",
    taxType: "vat",
    defaultRate: 21,
    categoryRates: {
      meals: 12,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Austria
  AT: {
    countryCode: "AT",
    taxType: "vat",
    defaultRate: 20,
    categoryRates: {
      meals: 10,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Italy
  IT: {
    countryCode: "IT",
    taxType: "vat",
    defaultRate: 22,
    categoryRates: {
      meals: 10,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Spain
  ES: {
    countryCode: "ES",
    taxType: "vat",
    defaultRate: 21,
    categoryRates: {
      meals: 10,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // United States
  US: {
    countryCode: "US",
    taxType: "sales_tax",
    defaultRate: 0, // No federal sales tax, varies by state
    categoryRates: {
      // Income categories (sales tax rate 0%)
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Conservative default rates for commonly taxed categories
      "office-supplies": 5, // Often taxed for small businesses
      equipment: 5, // Business equipment commonly taxed
      software: 4, // SaaS increasingly taxed by states
      meals: 6, // Restaurant meals almost always taxed
      "non-software-subscriptions": 4, // Physical subscriptions often taxed
      "promotional-materials": 5, // Marketing materials often taxed
      "facilities-expenses": 4, // Maintenance supplies often taxed
      "internet-and-telephone": 3, // Telecom services increasingly taxed
      "fixed-assets": 5, // Capital purchases commonly taxed
      // Categories that are typically exempt
      insurance: 0,
      benefits: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
      // Note: Actual sales tax rates vary by state (0-10%+)
      // SMBs should configure based on their state/local rates
    },
  },
  // United Kingdom
  GB: {
    countryCode: "GB",
    taxType: "vat",
    defaultRate: 20,
    categoryRates: {
      meals: 5,
      utilities: 5,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Canada
  CA: {
    countryCode: "CA",
    taxType: "gst",
    defaultRate: 5, // Federal GST only
    categoryRates: {
      // Income categories (GST rate 0%)
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Note: Provinces add PST/HST on top
      // This is just federal GST - actual rates vary by province
      insurance: 0,
      benefits: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
      // Most business expenses subject to 5% GST
      // Plus provincial PST/HST (varies 0-10% additional)
    },
  },
  // Australia
  AU: {
    countryCode: "AU",
    taxType: "gst",
    defaultRate: 10,
    categoryRates: {
      // Income categories (GST rate 0%)
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // GST exempt (0%)
      insurance: 0,
      benefits: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // New Zealand
  NZ: {
    countryCode: "NZ",
    taxType: "gst",
    defaultRate: 15,
    categoryRates: {
      // Income categories (GST rate 0%)
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // GST exempt (0%)
      insurance: 0,
      benefits: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Switzerland
  CH: {
    countryCode: "CH",
    taxType: "vat",
    defaultRate: 7.7,
    categoryRates: {
      meals: 7.7,
      utilities: 7.7,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Ireland
  IE: {
    countryCode: "IE",
    taxType: "vat",
    defaultRate: 23,
    categoryRates: {
      meals: 13.5,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Poland
  PL: {
    countryCode: "PL",
    taxType: "vat",
    defaultRate: 23,
    categoryRates: {
      meals: 8,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Czech Republic
  CZ: {
    countryCode: "CZ",
    taxType: "vat",
    defaultRate: 21,
    categoryRates: {
      meals: 12,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Portugal
  PT: {
    countryCode: "PT",
    taxType: "vat",
    defaultRate: 23,
    categoryRates: {
      meals: 13,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Luxembourg
  LU: {
    countryCode: "LU",
    taxType: "vat",
    defaultRate: 17,
    categoryRates: {
      meals: 8,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Estonia
  EE: {
    countryCode: "EE",
    taxType: "vat",
    defaultRate: 20,
    categoryRates: {
      meals: 9,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Latvia
  LV: {
    countryCode: "LV",
    taxType: "vat",
    defaultRate: 21,
    categoryRates: {
      meals: 12,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Lithuania
  LT: {
    countryCode: "LT",
    taxType: "vat",
    defaultRate: 21,
    categoryRates: {
      meals: 9,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Slovakia
  SK: {
    countryCode: "SK",
    taxType: "vat",
    defaultRate: 23,
    categoryRates: {
      meals: 10,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Slovenia
  SI: {
    countryCode: "SI",
    taxType: "vat",
    defaultRate: 22,
    categoryRates: {
      meals: 9.5,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Romania
  RO: {
    countryCode: "RO",
    taxType: "vat",
    defaultRate: 19,
    categoryRates: {
      meals: 9,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Hungary
  HU: {
    countryCode: "HU",
    taxType: "vat",
    defaultRate: 27,
    categoryRates: {
      meals: 18,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  // Turkey
  TR: {
    countryCode: "TR",
    taxType: "vat",
    defaultRate: 18,
    categoryRates: {
      meals: 8,
      // Income categories (VAT rate 0%)
      revenue: 0,
      income: 0,
      "product-sales": 0,
      "service-revenue": 0,
      "consulting-revenue": 0,
      "subscription-revenue": 0,
      "interest-income": 0,
      "other-income": 0,
      "customer-refunds": 0,
      "chargebacks-disputes": 0,
      // Other exempt categories
      insurance: 0,
      benefits: 0,
      salary: 0,
      "employer-taxes": 0,
      taxes: 0,
      "vat-gst-pst-qst-payments": 0,
      "sales-use-tax-payments": 0,
      "income-tax-payments": 0,
      "payroll-tax-remittances": 0,
      "government-fees": 0,
      "credit-card-payment": 0,
      "loan-proceeds": 0,
      "loan-principal-repayment": 0,
      "interest-expense": 0,
      "payment-platform-payouts": 0,
      // Banking & Finance categories (VAT rate 0%)
      "banking-finance": 0,
      "banking-fees": 0,
      transfer: 0,
      "internal-transfer": 0,
      payouts: 0,
      "processor-fees": 0,
      fees: 0,
      // Assets categories (VAT rate 0%)
      "assets-capex": 0,
      "fixed-assets": 0,
      "prepaid-expenses": 0,
      // Owner/Equity categories (VAT rate 0%)
      "owner-equity": 0,
      "owner-draws": 0,
      "capital-investment": 0,
      "charitable-donations": 0,
      uncategorized: 0,
    },
  },
  DEFAULT: {
    countryCode: "DEFAULT",
    taxType: null,
    defaultRate: 0,
    categoryRates: {},
  },
};

// Helper function to get tax rate for a specific category and country
export function getTaxRateForCategory(
  countryCode: string | undefined | null,
  categorySlug: string,
): number {
  const effectiveCountryCode = countryCode || "DEFAULT";
  const config =
    TAX_RATE_CONFIGS[effectiveCountryCode] || TAX_RATE_CONFIGS.DEFAULT;
  // Check if there's a specific rate for this category
  if (config?.categoryRates?.[categorySlug] !== undefined) {
    return config.categoryRates[categorySlug];
  }
  // Fall back to default rate
  return config?.defaultRate || 0;
}

// Helper function to get tax type for a country
export function getTaxTypeForCountry(
  countryCode: string | undefined | null,
): string | null {
  const effectiveCountryCode = countryCode || "DEFAULT";
  const config =
    TAX_RATE_CONFIGS[effectiveCountryCode] || TAX_RATE_CONFIGS.DEFAULT;
  return config?.taxType || null;
}

// Helper function to get all supported countries
export function getSupportedCountries(): string[] {
  return Object.keys(TAX_RATE_CONFIGS).filter((code) => code !== "DEFAULT");
}

// Helper function to check if a country is supported
export function isCountrySupported(countryCode: string | undefined): boolean {
  if (!countryCode) return false;
  return countryCode in TAX_RATE_CONFIGS;
}
